<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:c="http://java.sun.com/jsp/jstl/core"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:framework="http://java.sun.com/jsf/composite/framework">
	<ui:composition template="../template.xhtml">
		<ui:define name="content">
		
			<framework:searchEntity searchEntity="#{searchPost}">
				<f:facet name="options">
					<tr>
						<th>Blog</th>
						<td>
							<h:selectOneMenu value="#{searchPost.options.blogIdentifier}">
								<f:selectItem noSelectionOption="true"/>
								<f:selectItems value="#{searchPost.blogs}"
										   	   var="blog"
										   	   itemLabel="#{blog.name}"
										   	   itemValue="#{blog.identifier}"/>
							</h:selectOneMenu>						
						</td>
					</tr>				
					<tr>
						<th>Title</th>
						<td>
							<h:inputText value="#{searchPost.options.title}"/>						
						</td>
					</tr>
				</f:facet>
				
			
				<h:column>
						<f:facet name="header">Blog</f:facet>
						#{entity.blog.name}									
					</h:column>				 
							 
					<h:column>
						<f:facet name="header">Title</f:facet>
						<h:commandLink action="#{editPost.initialize(entity)}" value="#{entity.title}"/>								
					</h:column>
					
					<h:column>
						<f:facet name="header">Creation Date</f:facet>
						<h:outputText value="#{entity.creationDate}">
							<f:convertDateTime pattern="dd/MM/yyyy"/>
						</h:outputText>											
					</h:column>
					
					<h:column>
						<f:facet name="header"></f:facet>
						<h:commandLink action="#{deletePost.initialize(entity)}" value="Delete"/>
				</h:column>
				
			</framework:searchEntity>
					
		</ui:define>
	</ui:composition>
</html>
